package com.shop2cn.iapi.wxcomponent.parameter;

public enum ChargeStatusEnum {


    UNCHARGE(0,"未付费"),
    CHARGED(1,"已付费"),
    NONEEDCHARGE(2,"无需付费")
    ;


    private int code;
    private String message;

    ChargeStatusEnum(int code, String message) {
        this.code = code;
        this.message = message;
    }

    public int getCode() {
        return code;
    }

    public void setCode(int code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    /**
     * 通过代码获取枚举项
     *
     * @param code
     * @return
     */
    public static ChargeStatusEnum getByCode(int code) {
        for (ChargeStatusEnum chargeStatusEnum : ChargeStatusEnum.values()) {
            if (chargeStatusEnum.getCode() == code) {
                return chargeStatusEnum;
            }
        }
        return null;
    }
}
